package com.itheima.appserver.config;

import com.itheima.appserver.interceptor.Tokeninterceptor;
import com.itheima.appserver.interceptor.Tokeninterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @项目名称: tanhua-53
 * @包名: com.itheima.appserver.config
 * @作者: 李云飞
 * @日期: 2021-12-06
 */
//添加拦截器得什么路径
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Autowired
    Tokeninterceptor tokeninterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tokeninterceptor).addPathPatterns("/**");
    }
}
